﻿CREATE VIEW [dbo].[ASMS_V_MaintenanceBill]
	AS 
select MB.*,
	C.[Name] as CustomerName,
	C.[Telephone] as CustomerTelephone,
	A.[LPN] as LPN,
	S.Name as SalesManagerName,
	BB.Number as BookingBillNumber
from asms_maintenancebill as MB
	left join asms_customer as C on C.Id = MB.CustomerId
	left join asms_automobile as A on A.Id = MB.AutomobileId
	left join ASMS_Staff as S on S.Id = MB.SalesManagerId
	left join ASMS_BookingBill as BB on BB.Id = MB.BookingBillId
